[Ivy]
[>Created: Mon Mar 03 14:51:16 ICT 2014]
144729657D76880C 3.17 #module
>Proto >Proto Collection #zClass
Ml0 ManageEmail Big #zClass
Ml0 B #cInfo
Ml0 #process
Ml0 @TextInP .resExport .resExport #zField
Ml0 @TextInP .type .type #zField
Ml0 @TextInP .processKind .processKind #zField
Ml0 @AnnotationInP-0n ai ai #zField
Ml0 @TextInP .xml .xml #zField
Ml0 @TextInP .responsibility .responsibility #zField
Ml0 @EndSub f2 '' #zField
Ml0 @StartSub f3 '' #zField
Ml0 @GridStep f1 '' #zField
Ml0 @PushWFArc f0 '' #zField
Ml0 @StartSub f7 '' #zField
Ml0 @EndSub f8 '' #zField
Ml0 @GridStep f9 '' #zField
Ml0 @PushWFArc f10 '' #zField
Ml0 @PushWFArc f11 '' #zField
Ml0 @EndSub f12 '' #zField
Ml0 @StartSub f13 '' #zField
Ml0 @GridStep f14 '' #zField
Ml0 @PushWFArc f15 '' #zField
Ml0 @PushWFArc f16 '' #zField
Ml0 @DBStep f43 '' #zField
Ml0 @StartSub f17 '' #zField
Ml0 @EndSub f18 '' #zField
Ml0 @PushWFArc f19 '' #zField
Ml0 @PushWFArc f20 '' #zField
Ml0 @StartSub f21 '' #zField
Ml0 @EndSub f22 '' #zField
Ml0 @DBStep f23 '' #zField
Ml0 @PushWFArc f24 '' #zField
Ml0 @PushWFArc f25 '' #zField
Ml0 @GridStep f26 '' #zField
Ml0 @EndSub f27 '' #zField
Ml0 @StartSub f28 '' #zField
Ml0 @PushWFArc f31 '' #zField
Ml0 @Alternative f33 '' #zField
Ml0 @PushWFArc f34 '' #zField
Ml0 @GridStep f35 '' #zField
Ml0 @PushWFArc f30 '' #zField
Ml0 @PushWFArc f36 '' #zField
Ml0 @Alternative f38 '' #zField
Ml0 @PushWFArc f4 '' #zField
Ml0 @DBStep f6 '' #zField
Ml0 @PushWFArc f5 '' #zField
Ml0 @PushWFArc f39 '' #zField
Ml0 @DBStep f40 '' #zField
Ml0 @PushWFArc f41 '' #zField
Ml0 @PushWFArc f42 '' #zField
Ml0 @StartSub f44 '' #zField
Ml0 @GridStep f45 '' #zField
Ml0 @EndSub f46 '' #zField
Ml0 @PushWFArc f47 '' #zField
Ml0 @PushWFArc f48 '' #zField
Ml0 @DBStep f29 '' #zField
Ml0 @PushWFArc f32 '' #zField
Ml0 @PushWFArc f37 '' #zField
Ml0 @StartSub f49 '' #zField
Ml0 @EndSub f50 '' #zField
Ml0 @DBStep f51 '' #zField
Ml0 @PushWFArc f52 '' #zField
Ml0 @PushWFArc f53 '' #zField
>Proto Ml0 Ml0 ManageEmail #zField
Ml0 f2 type vn.axonactive.vision.data.EmailData #txt
Ml0 f2 115 443 26 26 14 0 #rect
Ml0 f2 @|EndSubIcon #fIcon
Ml0 f3 inParamDecl '<vn.axonactive.vision.entity.Email Email> param;' #txt
Ml0 f3 inParamTable 'out.email=param.Email;
' #txt
Ml0 f3 outParamDecl '<> result;
' #txt
Ml0 f3 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f3 callSignature insertNewEmail(vn.axonactive.vision.entity.Email) #txt
Ml0 f3 type vn.axonactive.vision.data.EmailData #txt
Ml0 f3 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>insertNewEmail(EmailData)</name>
        <nameStyle>25,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f3 115 68 26 25 14 0 #rect
Ml0 f3 @|StartSubIcon #fIcon
Ml0 f1 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f1 actionTable 'out=in;
' #txt
Ml0 f1 actionCode 'in.email.send_date = new DateTime();

if(in.email.subject.trim().isEmpty()) {
	in.email.subject = "(no subject)";	
}

if(in.email.content.trim().isEmpty()) {
	in.email.subject = "(no content)";	
}

ivy.log.info(in.email.is_draft);' #txt
Ml0 f1 type vn.axonactive.vision.data.EmailData #txt
Ml0 f1 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Prepare data</name>
        <nameStyle>12,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f1 110 140 36 24 20 -2 #rect
Ml0 f1 @|StepIcon #fIcon
Ml0 f0 expr out #txt
Ml0 f0 128 92 128 140 #arcP
Ml0 f7 outParamDecl '<java.util.List<vn.axonactive.vision.entity.Email> emailList> result;
' #txt
Ml0 f7 outParamTable 'result.emailList=in.emailList;
' #txt
Ml0 f7 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f7 callSignature getAllEmailsBelongToUser() #txt
Ml0 f7 type vn.axonactive.vision.data.EmailData #txt
Ml0 f7 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>getAllEmailsBelongToUser()</name>
        <nameStyle>26,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f7 667 92 26 25 14 0 #rect
Ml0 f7 @|StartSubIcon #fIcon
Ml0 f8 type vn.axonactive.vision.data.EmailData #txt
Ml0 f8 667 331 26 26 14 0 #rect
Ml0 f8 @|EndSubIcon #fIcon
Ml0 f9 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f9 actionTable 'out=in;
' #txt
Ml0 f9 actionCode 'import vn.axonactive.vision.service.EmailService;

in.emailList = EmailService.findAllEmailsBelongToUser(ivy.session.getSessionUser().getEMailAddress());
' #txt
Ml0 f9 type vn.axonactive.vision.data.EmailData #txt
Ml0 f9 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>get email from db</name>
        <nameStyle>17,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f9 662 204 36 24 20 -2 #rect
Ml0 f9 @|StepIcon #fIcon
Ml0 f10 expr out #txt
Ml0 f10 680 116 680 204 #arcP
Ml0 f11 expr out #txt
Ml0 f11 680 228 680 331 #arcP
Ml0 f12 type vn.axonactive.vision.data.EmailData #txt
Ml0 f12 867 339 26 26 14 0 #rect
Ml0 f12 @|EndSubIcon #fIcon
Ml0 f13 inParamDecl '<> param;' #txt
Ml0 f13 outParamDecl '<java.util.List<ch.ivyteam.ivy.security.IUser> memberList> result;
' #txt
Ml0 f13 outParamTable 'result.memberList=in.memberList;
' #txt
Ml0 f13 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f13 callSignature getAllMembers() #txt
Ml0 f13 type vn.axonactive.vision.data.EmailData #txt
Ml0 f13 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>getAllMembers()</name>
        <nameStyle>15,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f13 867 100 26 25 14 0 #rect
Ml0 f13 @|StartSubIcon #fIcon
Ml0 f14 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f14 actionTable 'out=in;
' #txt
Ml0 f14 actionCode 'import ch.ivyteam.ivy.security.IUser;
import vn.axonactive.vision.utils.BeanUtils;
import vn.axonactive.vision.service.EmailService;

List<IUser> members = BeanUtils.getUsersByRole("mailuser");
members.remove(ivy.session.getSessionUser());

in.setMemberList(members);' #txt
Ml0 f14 type vn.axonactive.vision.data.EmailData #txt
Ml0 f14 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>get member from test users</name>
        <nameStyle>26,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f14 862 212 36 25 20 -2 #rect
Ml0 f14 @|StepIcon #fIcon
Ml0 f15 expr out #txt
Ml0 f15 880 124 880 211 #arcP
Ml0 f16 expr out #txt
Ml0 f16 880 236 880 339 #arcP
Ml0 f43 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f43 actionTable 'out=in;
' #txt
Ml0 f43 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE DELETE SYSTEM  ""sqlStatements.dtd"">
<DELETE><Table name=''email''/><Condition><Relation kind=''=''><Column name=''id''/><AnyExpression>in.selectedEmailForDelete</AnyExpression></Relation></Condition></DELETE>' #txt
Ml0 f43 dbUrl WebMailDB #txt
Ml0 f43 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f43 dbWizard 'id = in.selectedEmailForDelete' #txt
Ml0 f43 lotSize 2147483647 #txt
Ml0 f43 startIdx 0 #txt
Ml0 f43 type vn.axonactive.vision.data.EmailData #txt
Ml0 f43 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Delete Email from DB</name>
        <nameStyle>20,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f43 1053 212 38 24 20 -2 #rect
Ml0 f43 @|DBStepIcon #fIcon
Ml0 f17 inParamDecl '<java.lang.Integer id> param;' #txt
Ml0 f17 inParamTable 'out.selectedEmailForDelete=param.id;
' #txt
Ml0 f17 outParamDecl '<> result;
' #txt
Ml0 f17 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f17 callSignature deleteEmail(Integer) #txt
Ml0 f17 type vn.axonactive.vision.data.EmailData #txt
Ml0 f17 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>deleteEmail(Integer id)</name>
        <nameStyle>23,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f17 1059 83 26 26 14 0 #rect
Ml0 f17 @|StartSubIcon #fIcon
Ml0 f18 type vn.axonactive.vision.data.EmailData #txt
Ml0 f18 1059 323 26 26 14 0 #rect
Ml0 f18 @|EndSubIcon #fIcon
Ml0 f19 expr out #txt
Ml0 f19 1072 109 1072 212 #arcP
Ml0 f20 expr out #txt
Ml0 f20 1072 236 1072 323 #arcP
Ml0 f21 inParamDecl '<java.lang.Integer id> param;' #txt
Ml0 f21 inParamTable 'out.selectedEmailForRead=param.id;
' #txt
Ml0 f21 outParamDecl '<> result;
' #txt
Ml0 f21 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f21 callSignature updateIsRead(Integer) #txt
Ml0 f21 type vn.axonactive.vision.data.EmailData #txt
Ml0 f21 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>updateIsRead(Integer)</name>
        <nameStyle>21,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f21 1299 91 26 26 14 0 #rect
Ml0 f21 @|StartSubIcon #fIcon
Ml0 f22 type vn.axonactive.vision.data.EmailData #txt
Ml0 f22 1291 339 26 26 14 0 #rect
Ml0 f22 @|EndSubIcon #fIcon
Ml0 f23 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f23 actionTable 'out=in;
' #txt
Ml0 f23 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE UPDATE SYSTEM  ""sqlStatements.dtd"">
<UPDATE><Table name=''email''/><Value column=''is_read''><String>1</String></Value><Condition><Relation kind=''=''><Column name=''id''/><AnyExpression>in.selectedEmailForRead</AnyExpression></Relation></Condition></UPDATE>' #txt
Ml0 f23 dbUrl WebMailDB #txt
Ml0 f23 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f23 dbWizard 'id = in.selectedEmailForRead' #txt
Ml0 f23 lotSize 2147483647 #txt
Ml0 f23 startIdx 0 #txt
Ml0 f23 type vn.axonactive.vision.data.EmailData #txt
Ml0 f23 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Update read status</name>
        <nameStyle>18,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f23 1286 212 36 24 20 -2 #rect
Ml0 f23 @|DBStepIcon #fIcon
Ml0 f24 expr out #txt
Ml0 f24 1311 116 1305 212 #arcP
Ml0 f25 expr out #txt
Ml0 f25 1304 236 1304 339 #arcP
Ml0 f26 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f26 actionTable 'out=in;
out.email.content=in.email.content;
out.email.is_draft=true;
out.email.is_read=false;
out.email.receiver=in.email.receiver;
out.email.sender=in.email.sender;
out.email.subject=in.email.subject;
' #txt
Ml0 f26 actionCode 'in.email.send_date = new DateTime();
in.email.sender = ivy.session.getSessionUser().getEMailAddress();' #txt
Ml0 f26 type vn.axonactive.vision.data.EmailData #txt
Ml0 f26 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Prepare data</name>
        <nameStyle>12,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f26 382 140 36 24 20 -2 #rect
Ml0 f26 @|StepIcon #fIcon
Ml0 f27 type vn.axonactive.vision.data.EmailData #txt
Ml0 f27 403 411 26 26 14 0 #rect
Ml0 f27 @|EndSubIcon #fIcon
Ml0 f28 inParamDecl '<vn.axonactive.vision.entity.Email Email> param;' #txt
Ml0 f28 inParamTable 'out.email=param.Email;
' #txt
Ml0 f28 outParamDecl '<vn.axonactive.vision.entity.Email draftEmail> result;
' #txt
Ml0 f28 outParamTable 'result.draftEmail=in.email;
' #txt
Ml0 f28 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f28 callSignature createOrUpdateMailAsDraft(vn.axonactive.vision.entity.Email) #txt
Ml0 f28 type vn.axonactive.vision.data.EmailData #txt
Ml0 f28 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>createOrUpdateMailAsDraft(EmailData)</name>
        <nameStyle>36,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f28 387 76 26 25 14 0 #rect
Ml0 f28 @|StartSubIcon #fIcon
Ml0 f31 expr out #txt
Ml0 f31 400 100 400 140 #arcP
Ml0 f33 type vn.axonactive.vision.data.EmailData #txt
Ml0 f33 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>check if email already exists</name>
        <nameStyle>29,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f33 386 226 28 28 14 0 #rect
Ml0 f33 @|AlternativeIcon #fIcon
Ml0 f34 expr out #txt
Ml0 f34 400 164 400 226 #arcP
Ml0 f35 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f35 actionTable 'out=in;
' #txt
Ml0 f35 actionCode 'import vn.axonactive.vision.entity.Email;

Email newEmail = new Email();
newEmail.setIs_draft(in.email.is_draft);
newEmail.setIs_read(in.email.is_read);
newEmail.setContent(in.email.content);
newEmail.setSubject(in.email.subject);
newEmail.setSend_date(in.email.send_date);
newEmail.setSender(in.email.sender);
newEmail.setReceiver(in.email.receiver);

ivy.persistence.WebMailDBPersistence.persist(newEmail);
ivy.log.info(newEmail.getId());

in.email.id = newEmail.getId();' #txt
Ml0 f35 type vn.axonactive.vision.data.EmailData #txt
Ml0 f35 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Insert draft Mail</name>
        <nameStyle>17,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f35 326 292 36 24 20 -2 #rect
Ml0 f35 @|StepIcon #fIcon
Ml0 f30 expr in #txt
Ml0 f30 outCond 'in.email.id == 0' #txt
Ml0 f30 393 247 355 292 #arcP
Ml0 f36 expr out #txt
Ml0 f36 351 316 409 412 #arcP
Ml0 f38 type vn.axonactive.vision.data.EmailData #txt
Ml0 f38 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>check if there is draft email</name>
        <nameStyle>29,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f38 114 282 28 28 14 0 #rect
Ml0 f38 @|AlternativeIcon #fIcon
Ml0 f4 expr out #txt
Ml0 f4 128 164 128 282 #arcP
Ml0 f6 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f6 actionTable 'out=in;
' #txt
Ml0 f6 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE ANY_SQL SYSTEM  ""sqlStatements.dtd"">
<ANY_SQL><Verbatim quote=''true''>INSERT INTO email (content, is_read, receiver, send_date, sender, subject, is_draft)
VALUES (in.email.content, &#39;0&#39;, in.email.receiver, in.email.send_date, in.email.sender, in.email.subject, &#39;0&#39;)</Verbatim></ANY_SQL>' #txt
Ml0 f6 dbUrl WebMailDB #txt
Ml0 f6 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f6 dbWizard 'INSERT INTO email (content, is_read, receiver, send_date, sender, subject, is_draft)
VALUES (in.email.content, ''0'', in.email.receiver, in.email.send_date, in.email.sender, in.email.subject, ''0'')' #txt
Ml0 f6 lotSize 2147483647 #txt
Ml0 f6 startIdx 0 #txt
Ml0 f6 type vn.axonactive.vision.data.EmailData #txt
Ml0 f6 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Insert Mail</name>
        <nameStyle>11,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f6 222 340 36 24 20 -2 #rect
Ml0 f6 @|DBStepIcon #fIcon
Ml0 f5 expr in #txt
Ml0 f5 outCond 'in.email.id == 0' #txt
Ml0 f5 137 301 222 343 #arcP
Ml0 f39 expr out #txt
Ml0 f39 227 364 137 447 #arcP
Ml0 f40 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f40 actionTable 'out=in;
' #txt
Ml0 f40 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE UPDATE SYSTEM  ""sqlStatements.dtd"">
<UPDATE><Table name=''email''/><Value column=''content''><AnyExpression>in.email.content</AnyExpression></Value><Value column=''receiver''><AnyExpression>in.email.receiver</AnyExpression></Value><Value column=''send_date''><AnyExpression>in.email.send_date</AnyExpression></Value><Value column=''subject''><AnyExpression>in.email.subject</AnyExpression></Value><Value column=''is_draft''><String>0</String></Value><Condition><Relation kind=''=''><Column name=''id''/><AnyExpression>in.email.id</AnyExpression></Relation></Condition></UPDATE>' #txt
Ml0 f40 dbUrl WebMailDB #txt
Ml0 f40 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f40 dbWizard 'id = in.email.id' #txt
Ml0 f40 lotSize 2147483647 #txt
Ml0 f40 startIdx 0 #txt
Ml0 f40 type vn.axonactive.vision.data.EmailData #txt
Ml0 f40 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Update is_draft to false</name>
        <nameStyle>24,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f40 22 340 36 24 20 -2 #rect
Ml0 f40 @|DBStepIcon #fIcon
Ml0 f41 expr in #txt
Ml0 f41 outCond 'in.email.id != 0' #txt
Ml0 f41 119 301 58 341 #arcP
Ml0 f42 expr out #txt
Ml0 f42 50 364 119 446 #arcP
Ml0 f44 outParamDecl '<java.util.List<vn.axonactive.vision.entity.Email> draftEmailList> result;
' #txt
Ml0 f44 outParamTable 'result.draftEmailList=in.draftEmailList;
' #txt
Ml0 f44 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f44 callSignature getAllDraftEmailsBelongToUser() #txt
Ml0 f44 type vn.axonactive.vision.data.EmailData #txt
Ml0 f44 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>getAllDraftEmailsBelongToUser()</name>
        <nameStyle>31,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f44 1515 100 26 25 14 0 #rect
Ml0 f44 @|StartSubIcon #fIcon
Ml0 f45 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f45 actionTable 'out=in;
' #txt
Ml0 f45 actionCode 'import vn.axonactive.vision.service.EmailService;

in.draftEmailList = EmailService.findDraftEmailsBelongToUser(ivy.session.getSessionUser().getEMailAddress());

' #txt
Ml0 f45 type vn.axonactive.vision.data.EmailData #txt
Ml0 f45 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>get email from db</name>
        <nameStyle>17,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f45 1510 212 36 24 20 -2 #rect
Ml0 f45 @|StepIcon #fIcon
Ml0 f46 type vn.axonactive.vision.data.EmailData #txt
Ml0 f46 1515 339 26 26 14 0 #rect
Ml0 f46 @|EndSubIcon #fIcon
Ml0 f47 expr out #txt
Ml0 f47 1528 124 1528 212 #arcP
Ml0 f48 expr out #txt
Ml0 f48 1528 236 1528 339 #arcP
Ml0 f29 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f29 actionTable 'out=in;
' #txt
Ml0 f29 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE UPDATE SYSTEM  ""sqlStatements.dtd"">
<UPDATE><Table name=''email''/><Value column=''content''><AnyExpression>in.email.content</AnyExpression></Value><Value column=''receiver''><AnyExpression>in.email.receiver</AnyExpression></Value><Value column=''subject''><AnyExpression>in.email.subject</AnyExpression></Value><Condition><Relation kind=''=''><Column name=''id''/><AnyExpression>in.email.id</AnyExpression></Relation></Condition></UPDATE>' #txt
Ml0 f29 dbUrl WebMailDB #txt
Ml0 f29 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f29 dbWizard 'id = in.email.id' #txt
Ml0 f29 lotSize 2147483647 #txt
Ml0 f29 startIdx 0 #txt
Ml0 f29 type vn.axonactive.vision.data.EmailData #txt
Ml0 f29 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>update email</name>
        <nameStyle>12,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f29 462 300 36 24 20 -2 #rect
Ml0 f29 @|DBStepIcon #fIcon
Ml0 f32 expr in #txt
Ml0 f32 outCond 'in.email.id != 0' #txt
Ml0 f32 407 247 467 300 #arcP
Ml0 f37 expr out #txt
Ml0 f37 473 324 422 412 #arcP
Ml0 f49 outParamDecl '<> result;
' #txt
Ml0 f49 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f49 callSignature deleteReadEmail() #txt
Ml0 f49 type vn.axonactive.vision.data.EmailData #txt
Ml0 f49 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>deleteReadEmail()</name>
        <nameStyle>17,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f49 1771 99 26 26 14 0 #rect
Ml0 f49 @|StartSubIcon #fIcon
Ml0 f50 type vn.axonactive.vision.data.EmailData #txt
Ml0 f50 1779 347 26 26 14 0 #rect
Ml0 f50 @|EndSubIcon #fIcon
Ml0 f51 actionDecl 'vn.axonactive.vision.data.EmailData out;
' #txt
Ml0 f51 actionTable 'out=in;
' #txt
Ml0 f51 dbSql '<?xml version=""1.0"" standalone=""no""?>
<!DOCTYPE DELETE SYSTEM  ""sqlStatements.dtd"">
<DELETE><Table name=''email''/><Condition><Relation kind=''=''><Column name=''is_read''/><Number>1</Number></Relation></Condition></DELETE>' #txt
Ml0 f51 dbUrl WebMailDB #txt
Ml0 f51 cache '{/cache false /invalidation false /scope 0 /groupname ""/lifetime_group "0"/invalidation_time_group ""/identifier ""/lifetime_entry "0"/invalidation_time_entry ""}' #txt
Ml0 f51 dbWizard 'is_read = 1' #txt
Ml0 f51 lotSize 2147483647 #txt
Ml0 f51 startIdx 0 #txt
Ml0 f51 type vn.axonactive.vision.data.EmailData #txt
Ml0 f51 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>delete read email</name>
        <nameStyle>17,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ml0 f51 1774 220 36 24 20 -2 #rect
Ml0 f51 @|DBStepIcon #fIcon
Ml0 f52 expr out #txt
Ml0 f52 1784 124 1791 220 #arcP
Ml0 f53 expr out #txt
Ml0 f53 1792 244 1792 347 #arcP
>Proto Ml0 .type vn.axonactive.vision.data.EmailData #txt
>Proto Ml0 .processKind CALLABLE_SUB #txt
>Proto Ml0 0 0 32 24 18 0 #rect
>Proto Ml0 @|BIcon #fIcon
Ml0 f3 mainOut f0 tail #connect
Ml0 f0 head f1 mainIn #connect
Ml0 f7 mainOut f10 tail #connect
Ml0 f10 head f9 mainIn #connect
Ml0 f9 mainOut f11 tail #connect
Ml0 f11 head f8 mainIn #connect
Ml0 f13 mainOut f15 tail #connect
Ml0 f15 head f14 mainIn #connect
Ml0 f14 mainOut f16 tail #connect
Ml0 f16 head f12 mainIn #connect
Ml0 f17 mainOut f19 tail #connect
Ml0 f19 head f43 mainIn #connect
Ml0 f43 mainOut f20 tail #connect
Ml0 f20 head f18 mainIn #connect
Ml0 f21 mainOut f24 tail #connect
Ml0 f24 head f23 mainIn #connect
Ml0 f23 mainOut f25 tail #connect
Ml0 f25 head f22 mainIn #connect
Ml0 f28 mainOut f31 tail #connect
Ml0 f31 head f26 mainIn #connect
Ml0 f26 mainOut f34 tail #connect
Ml0 f34 head f33 in #connect
Ml0 f33 out f30 tail #connect
Ml0 f30 head f35 mainIn #connect
Ml0 f35 mainOut f36 tail #connect
Ml0 f36 head f27 mainIn #connect
Ml0 f1 mainOut f4 tail #connect
Ml0 f4 head f38 in #connect
Ml0 f38 out f5 tail #connect
Ml0 f5 head f6 mainIn #connect
Ml0 f6 mainOut f39 tail #connect
Ml0 f39 head f2 mainIn #connect
Ml0 f38 out f41 tail #connect
Ml0 f41 head f40 mainIn #connect
Ml0 f40 mainOut f42 tail #connect
Ml0 f42 head f2 mainIn #connect
Ml0 f44 mainOut f47 tail #connect
Ml0 f47 head f45 mainIn #connect
Ml0 f45 mainOut f48 tail #connect
Ml0 f48 head f46 mainIn #connect
Ml0 f33 out f32 tail #connect
Ml0 f32 head f29 mainIn #connect
Ml0 f29 mainOut f37 tail #connect
Ml0 f37 head f27 mainIn #connect
Ml0 f49 mainOut f52 tail #connect
Ml0 f52 head f51 mainIn #connect
Ml0 f51 mainOut f53 tail #connect
Ml0 f53 head f50 mainIn #connect
